home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 351-375 / 359 / dice / dice.lzh / lib / string / stricmp.c < prev    next >
C/C++ Source or Header  |  1990-05-17  |  375b  |  30 lines

  1.  
  2. /*
  3.  *  STRICMP.C
  4.  *
  5.  *  (C)Copyright 1990, Matthew Dillon, All Rights Reserved
  6.  */
  7.  
  8. #include <string.h>
  9. #include <ctype.h>
  10.  
  11. typedef unsigned char ubyte;
  12.  
  13. int
  14. stricmp(s, d)
  15. const char *s;
  16. const char *d;
  17. {
  18.     while (tolower(*(ubyte *)s) == tolower(*(ubyte *)d)) {
  19.     if (*s == 0)
  20.         return(0);
  21.     ++s;
  22.     ++d;
  23.     }
  24.     if ((ubyte)*s < (ubyte)*d)
  25.     return(-1);
  26.     return(1);
  27. }
  28.  
  29.  
  30.